<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        // 数组结构
        // let arr = [1,2,3];

        // // let a = arr[0]
        // // let b = arr[1]
        // // let c = arr[2]

        // let [a,b,c] = arr;

        // console.log(a,b,c)

        // 对象结构
        const person = {
            name:'微雨',
            age:22,
            language:['java','javascript','css','html']
        }

        // let name = person.name;
        // let age = person.age;
        // let language = person.language;

        let {name,age,language} = person;
        console.log(name,age,language)

        // 将Person中的name属性重新命名为abc
        // let {name:abc,age,language} = person;
        // console.log(abc,age,language)

        // 字符串扩展
        let str = 'hello.vue';
        console.log(str.startsWith('hello'))
        console.log(str.endsWith('.vue'))
        console.log(str.includes('hello'))

        // 字符串模板
        let ss = `<div>
                    <span>落花人独立，微雨燕双飞。</span>
                </div>`

        console.log(ss)

        // 在字符串中插入变量和表达式 ${},【注】：此处应该使用``(反引号)
        function fun(){
            return '明年想找个女朋友';
        }
        let s = `我是${name},我今年${age + 1}岁了,${fun()}`
        console.log(s)
    </script>
</body>
</html>